Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

152
Views
I just want to select the button with the text "Continue" within a website with cypress

When I search for the button by the common method it returns 2 results

cy.get('[data-testid="cc-button__element"] > [data-testid="cc-button__text"]')

screenshot-1

However, when I do the search with cypress's own tool, it does locate it quickly and returns 1 result.

cy.get('.block > [data-testid="cc-button"] > [data-testid="cc-button__element"]')

screenshot-2

I know that this is valid, however, I want to do it by the traditional method so that later if there are changes it does not affect my button search methods.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

If the text Continue occurs just once in your webpage you can use contains to find it and click it.

cy.contains('Continue').click()
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!